package com.systemmanger.mapper;

import com.bean.WmsTCustomer;
import com.bean.WmsTUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @AUTHOR(闫晨航)
 * @date2021-12-03 14:49
 */
public interface CustomerMapper {
    @Select("select * from wms_t_customer where custIsDel='0'")
    List<WmsTCustomer> getAllCustomers();
    @Select("<script>select * from wms_t_customer\n" +
            "        where 1=1\n" +
            "        <if test=\"custName!=null\">\n" +
            "            and custName = #{custName}\n" +
            "        </if>\n" +
            "        <if test=\"custIC!=null\">\n" +
            "            and custIC = #{custIC}\n" +
            "        </if>\n" +
            "        <if test=\"custID!=null\">\n" +
            "            and custID = #{custID}\n" +
            "        </if> and custIsDel='0'\n" +
            "</script>")
    List<WmsTCustomer> getCustomers(Map<String, Object> map);
    @Select("select * from wms_t_customer where custID=#{value}")
    public WmsTCustomer getOneCus(String custID);
    @Update("update wms_t_customer set custIsDel='1' where custID = #{custId}")
    public void deleteBycustomer(WmsTCustomer wmsTCustomer);
    @Update("update wms_t_customer set custNote=#{custNote},custMobile=#{custMobile},custName=#{custName},custIC=#{custIc},custTel=#{custTel},custNote=#{custNote},custEditTime=#{custEditTime} where custID = #{custId}")
    void updateByCustomer(WmsTCustomer wmsTCustomer);

}
